import {createStore,applyMiddleware} from "redux";
import thunkMiddleware from 'redux-thunk';
import {createLogger} from 'redux-logger';
import rootReducer from './index';
import {persistStore,persistReducer} from "redux-persist";
import storage from 'redux-persist/es/storage';

const persistConfig={
    key:'root',
    storage:storage,
    blacklist:[]
};

const myPersistReducer=persistReducer(persistConfig,rootReducer);
const loggerMiddleware=createLogger();

const store=createStore(
    myPersistReducer,
    applyMiddleware(
        thunkMiddleware,
        loggerMiddleware
    )
);
const myPersistStore=persistStore(store);
export {store,myPersistStore};
